]> dgit.raspbian.org Git - gnome-shell.git/commit
iconGrid: Save class variables to local ones
authorJonas Dreßler <verdre@v0yd.nl>
Wed, 24 Feb 2021 11:07:03 +0000 (12:07 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 3 Mar 2021 17:59:16 +0000 (17:59 +0000)
commit7771bf4437d236f69121f458273743fe7d565b69
treea6fdc0b00d6f0c56adac8f7680ecf7b839bf09c9
parent7a5650d8682860bc40d3679e3752e5fccc876661
iconGrid: Save class variables to local ones

It's quite slow to access class variables in JS, especially when they're
backed by GObject properties. To avoid accessing them in every iteration
when we're looping through the children of iconGrid, store those values
to another variable and reuse that inside the loop.

This shaves off another 0.2 ms from iconGrids vfunc_allocate(), getting
the average time spent in that function down from 1.3 ms to 1.1 ms.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1713>
js/ui/iconGrid.js